home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 4 / Amiga Tools 4.iso / tools / netzwerk / parnet / sources / tag.asm < prev    next >
Assembly Source File  |  1996-02-26  |  2KB  |  133 lines

  1.  
  2.         ;   TAG.ASM
  3.         ;
  4.         ;   Tag for PARNET.DEVICE   (Parallel Port Network)
  5.         ;
  6.         ;   Provides unit vectoring of commands and C layering.
  7.  
  8.         include "exec/types.i"
  9.         include "exec/exec.i"
  10.         include "exec/resident.i"
  11.  
  12.         section text,code
  13.  
  14.         xref    _LVORemTask
  15.  
  16.         xref    _CDevInit    ; C routines for assembly tags
  17.         xref    _CDevOpen
  18.         xref    _CDevClose
  19.         xref    _CDevExpunge
  20.         xref    _LinkerDB    ; Lattice C linker A4 base (ea)
  21.  
  22.         xref    _CParNetTask
  23.  
  24.         xref    _UnitControlOpen
  25.         xref    _UnitDGramOpen
  26.         xref    _UnitStreamOpen
  27.  
  28.         xdef    @ParNetTask
  29.         xdef    _ParNetTask
  30.  
  31.         moveq.l #-1,D0
  32.         rts
  33.  
  34. InitDesc:
  35.         dc.w    RTC_MATCHWORD
  36.         dc.l    InitDesc
  37.         dc.l    EndCode
  38.         dc.b    0        ;   not auto-init
  39.         dc.b    2        ;   version
  40.         dc.b    NT_DEVICE
  41.         dc.b    0        ;   priority
  42.         dc.l    _DeviceName
  43.         dc.l    _IdString
  44.         dc.l    _DevInit
  45.         dc.l    0        ;   extra ?
  46.         dc.l    0
  47.         dc.l    0
  48.  
  49.  
  50.         section __MERGED,DATA
  51.  
  52.         xdef    _DeviceName    ; tag strings
  53.         xdef    _IdString
  54.         xdef    _DeviceVectors    ; device vectors
  55.         xdef    _UnitVectors
  56.  
  57. _DeviceName:    dc.b    'parnet.device',0
  58. _IdString:    dc.b    'parnet.device 2.0 (23 Dec 1990)',13,10,0
  59.  
  60.         ds.l    0
  61.  
  62. _DeviceVectors:
  63.         dc.l    _DevOpen
  64.         dc.l    _DevClose
  65.         dc.l    _DevExpunge
  66.         dc.l    0
  67.         dc.l    _DevBeginIO
  68.         dc.l    _DevAbortIO
  69.         dc.l    -1
  70.  
  71. _UnitVectors:
  72.         dc.l    _UnitControlOpen
  73.         dc.l    _UnitDGramOpen
  74.         dc.l    _UnitStreamOpen
  75.  
  76. EndCode:
  77.         section text,code
  78.  
  79. _DevInit:    movem.l A0/A4,-(sp)         ;   A0=segment
  80.         lea    _LinkerDB,A4        ;    Lattice C
  81.         jsr    _CDevInit
  82.         movem.l (sp)+,A0/A4
  83.         rts
  84.  
  85. _DevOpen:    movem.l D0/D1/A1/A4,-(sp)   ;   D0=unit, D1=flags, A1=iob
  86.         lea    _LinkerDB,A4
  87.         jsr    _CDevOpen
  88.         addq.l    #4,sp
  89.         movem.l (sp)+,D1/A1/A4
  90.         rts
  91.  
  92. _DevClose:    movem.l A1/A4,-(sp)         ;   A1=iob
  93.         lea    _LinkerDB,A4
  94.         jsr    _CDevClose
  95.         movem.l (sp)+,A1/A4
  96.         rts
  97.  
  98. _DevExpunge:    move.l    A4,-(sp)            ;
  99.         lea    _LinkerDB,A4
  100.         jsr    _CDevExpunge
  101.         move.l    (sp)+,A4
  102.         rts
  103.  
  104. _DevBeginIO:    movem.l A1/A4,-(sp)         ; A1=iob
  105.         move.l    IO_UNIT(A1),A0      ; vector through unit
  106.         move.l    LN_SIZE(A0),A0      ; (see defs.h/Unit)
  107.         lea    _LinkerDB,A4
  108.         jsr    (A0)
  109.         movem.l (sp)+,A1/A4
  110.         rts
  111.  
  112. _DevAbortIO:    movem.l A1/A4,-(sp)         ; A1=iob
  113.         move.l    IO_UNIT(A1),A0      ; vector through unit
  114.         move.l    LN_SIZE+4(A0),A0    ; (see defs.h/Unit)
  115.         lea    _LinkerDB,A4
  116.         jsr    (A0)
  117.         movem.l (sp)+,A1/A4
  118.         rts
  119.  
  120. @ParNetTask:
  121. _ParNetTask:
  122.         lea    _LinkerDB,A4
  123.         jsr    _CParNetTask
  124.         move.l    4,A6
  125.         sub.l    A1,A1
  126.         jsr    _LVORemTask(A6)
  127. rt        jmp    rt
  128.  
  129.  
  130.  
  131.         END
  132.  
  133.